/*
 * @Author: Qimu
 * @Date: 2020-04-17 08:36:48
 * @LastEditors: Qimu
 * @LastEditTime: 2020-06-26 12:17:20
 * @Description: file content
 * @FilePath: \vue-admin-koa2\koa2_api\module\schama\admin.js
 */
const mongoose = require('../db/mongodb');
const config = require('../config/config');

// const moment = require('moment');
// moment.locale('zh-cn')
const adminSchema = mongoose.Schema({
  admin_avatar: { //管理员头像
    type: String
  },
  admin_name: { //管理员账号
    type: String,
    required: true,
    trim: true
  },
  admin_password: { //管理员密码
    type: String,
    required: true,
    trim: true
  },
  admin_email: { //管理员邮箱
    type: String,
    required: true,
    trim: true
  },
  admin_tel: { //管理员电话
    type: String,
    required: true,
    trim: true
  },
  admin_role: { //管理员当前角色
    type: String,
    required: true,
    trim: true
  },
  create_adminTime: { //新增管理员用户时间
    type: String,
    required: true,
    trim: true,
  },
  last_loginTime: { //最后一次登录时间
    type: String,
    required: true,
    trim: true,
  },
  admin_status: { //管理员状态
    type: Number,
    default: 1
  },
})

module.exports = Admin = mongoose.model('Admin', adminSchema, `${config.mongodb.table}admin`);